<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />

 <input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >

<div style="margin-bottom: 5px;">
    		<strong>温馨提示：</strong><br/>
    		<security:authorize ifNotGranted="A_DAILU_PROPOSAL">
    		单位信息从【单位维护表】中导入，由单位管理员填写，如有疑问请联系单位管理员进行修改。 
    		</security:authorize>
    		<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
    		单位信息从【单位维护表】中导入，如有数据需要调整，请您到【系统管理】->【单位信息维护】功能进行修改 。
    		</security:authorize>
</div>

<div class="t_bar">单位基本情况</div>
<table class="t_css" width="100%" border="0" cellpadding="0"
	id="orgInfo" cellspacing="1">
		<col width="20%"/>
		<col width="12%"/>
		<col width="23%"/>
		<col width="18%"/>
		<col width="12%"/>
		<col width="15%"/>
		
	<tr>
		<td  align="right">单位名称：</td>
		<td colspan="5">&nbsp;<span name="organizations/organization[0]/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" />
		    </span>
		</td>
	</tr>
	
	<tr>
		<td align="right">详细地址：</td>
		<td colspan="3">&nbsp;
		    <span name="organizations/organization[0]/address"> 
			    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/address" /> 
		    </span>
		</td>
		<td align="right">邮政编码：</td>
		<td colspan="1">&nbsp;
		    <span name="organizations/organization[0]/zip_code"> 
			    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/zip_code" /> 
		    </span>
		</td>
	</tr>
	
	<!-- 单位负责人 -->
	<tr>
		<td  align="right" rowspan="3">单位负责人：</td>
		<td  align="right">姓名：</td>
		<td>
		    <span name="organization_persons/cname"> 
			    <x:out select="$xmlData/data/organization_persons/person[@type='fuzeren']/cname"/>
		    </span>
		</td>
		<td  align="right">职务：</td>
		<td colspan="2">
			<span name="organization_persons/position"> 
			    <x:out select="$xmlData/data/organization_persons/person[@type='fuzeren']/position"/>
		    </span>
		</td>
		
	</tr> 
	<tr>
		<td align="right">职称：</td>
		<td >
			<span name="organization_persons/prof_title_name"> 
			    <x:out select="$xmlData/data/organization_persons/person[@type='fuzeren']/prof_title_name"/>
		    </span>
		</td>
		<td align="right">联系电话：</td>
		<td colspan="2">
			<span name="organization_persons/tel"> 
			    <x:out select="$xmlData/data/organization_persons/person[@type='fuzeren']/tel"/>
		    </span>
		</td>
	</tr>
	<tr>
		<td  align="right">手机号码：</td>
		<td  >
			<span name="organization_persons/mobile"> 
			    <x:out select="$xmlData/data/organization_persons/person[@type='fuzeren']/mobile"/>
		    </span>
		</td>
		<td  align="right"><span class="color_red">*</span>电子邮箱：</td>
		<td  colspan="2">
			<input  name="organization_persons2/mail" label="单位负责人电子邮箱" type="text"  style="width: 70%"  class="input_css required email"   maxlength="100" value="<x:out select="$xmlData/data/organization_persons2/mail" />"/> 
		</td>
	</tr>
	
	
	<!-- 项目负责人 -->
	<tr>
		<td  align="right" rowspan="3">项目负责人：</td>
		<td  align="right">姓名：</td>
		<td>
		    <span name="proposal/fzr_psnname" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		
				<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
					<span id="personSelect">
					<input type="button" class="button_02" style="height: 25px; padding: 1px;" id="selectPsn" value="设置">
					<cpt:personSelect key="personSelect" addRole="3" psnCode="${param.psnCode }" callback="selectPsnCall" bindEvent="click" bindObject="selectPsn" title="设置项目负责人" fltFile="personSelector.ftl"></cpt:personSelect>
					</span>
				</security:authorize>
		</td>
		<td  align="right">职务：</td>
		<td colspan="2">
			<span name="proposal/fzr_position" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/position" /></span>
		</td>
		
	</tr> 
	<security:authorize ifNotGranted="A_DAILU_PROPOSAL">
		<tr>
		<td align="right">职称：</td>
		<td >
			<span name="proposal/fzr_prof_title_name" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name" /></span>
			<input type="hidden" id="prof_title_value" name="prof_title_value" value="" />
		</td>
		<!-- 直接读取申报人信息 -->
		<td  align="right">联系电话：</td>
		<td  colspan="2">
			<span name="proposal/fzr_tel" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
		</td>
	</tr>
	<tr>
	<td  align="right">手机号码：</td>
		<td>
			<span name="proposal/fzr_mobile" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
		</td>
		<td  align="right">电子邮箱：</td>
		<td  colspan="2">
		<span name="proposal/fzr_mail"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
		</td>
	</tr>
	</security:authorize>
	<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
	<tr>
	<td align="right">职称：</td>
		<td >
			<span name="proposal/fzr_prof_title_name" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name" /></span>
			<input type="hidden" id="prof_title_value" name="prof_title_value" value="" />
		</td>
		<td  align="right"><span class="color_red">*</span>联系电话：</td>
		<td  colspan="2">
			 <c:set var="tel"><x:out select="$xmlData/data/proposal/fzr_tel"/></c:set>
			 <c:if test="${tel!='' }">
			 		<input  name="proposal/fzr_tel" label="项目负责人联系电话" type="text" required class="required" style="width: 70%;"  maxlength="100" value="<x:out select="$xmlData/data/proposal/fzr_tel"/>"/> 
			 </c:if>
			 <c:if test="${tel=='' }">
			 <input  name="proposal/fzr_tel" label="项目负责人联系电话" type="text" required class="required" style="width: 70%;"  maxlength="100" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" />"/> 
			 </c:if>
		</td>
	</tr>
	<tr>
	<td  align="right"><span class="color_red">*</span>手机号码：</td>
		<td  >
			<c:set var="mobile"><x:out select="$xmlData/data/proposal/fzr_mobile"/></c:set>
			 <c:if test="${mobile!='' }">
			 <input  name="proposal/fzr_mobile" label="项目负责人手机号码" type="text" required class="required mobile" style="width: 80%;"  maxlength="11" value="<x:out select="$xmlData/data/proposal/fzr_mobile"/>"/> 
			 </c:if>
			  <c:if test="${mobile=='' }">
			 <input  name="proposal/fzr_mobile" label="项目负责人手机号码" type="text" required class="required mobile" style="width: 80%;"  maxlength="11" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" />"/> 
			 </c:if>
		</td>
		<td  align="right">电子邮箱：</td>
		<td  colspan="2">
		<span name="proposal/fzr_mail"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
		</td>
	</tr>
	</security:authorize>
	
	<!-- 项目联系人 -->
	<tr>
		<td  align="right" rowspan="3">项目联系人：</td>
		<td  align="right"><span class="color_red">*</span>姓名：</td>
		<td>
			<input name="proposal/contact_psn_cname" label="项目联系人姓名" type="text"  class="input_css required"  style="width: 80%"  maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>职务：</td>
		<td colspan="2">
			<input name="proposal/contact_psn_position" label="项目联系人职务" type="text"  class="input_css required"  style="width: 70%"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_position" />"/> 
		</td>
	</tr>
	
	<tr>
		<td  align="right"><span class="color_red">*</span>职称：</td>
		<td nowrap="nowrap">
				<c:set var="prof_title">{id:'<x:out select="$xmlData/data/proposal/contact_psn_prof_title_value" />',name:'<x:out select="$xmlData/data/proposal/contact_psn_prof_title_name" />'}</c:set>
			<cpt:tree key="prof_title" cacheable="false" readonly="true" value="${prof_title}" id="prof_title" name="prof_title"  showPattern="all" shieldPattern="-1" onClick="initTreeValueExt"   label="职称" width="65%" />
			<input type="hidden" id="prof_title_value" name="proposal/contact_psn_prof_title_value" value="<x:out select="$xmlData/data/proposal/contact_psn_prof_title_value" />" class="required"  label="项目联系人职称"/> 
			<input type="hidden" id="prof_title_name"  name="proposal/contact_psn_prof_title_name" value="<x:out select="$xmlData/data/proposal/contact_psn_prof_title_name" />" />
		</td>
		<td  align="right"><span class="color_red">*</span>联系电话：</td>
		<td colspan="2" >
			<input  name="proposal/contact_psn_tel" label="项目联系人联系电话" type="text"  class="input_css required"  style="width: 70%"    maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_tel" />"/> 
		</td>
	</tr>
	<tr>
		<td  align="right"><span class="color_red">*</span>手机号码：</td>
		<td  >
			<input  name="proposal/contact_psn_mobile" label="项目联系人手机号码" type="text"  maxlength="11"  style="width: 80%"  class="input_css required mobile" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>电子邮箱：</td>
		<td  colspan="2">
			<input  name="proposal/contact_psn_email" label="项目联系人电子邮箱" type="text"  style="width: 70%"  class="input_css required email"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/> 
		</td>
	</tr>
</table>

<script type="text/javascript">
function initTreeValueExt(treeId, treeNode) {
	  if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
		scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
		if (treeNode.level == 0) {
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
		}
		return false;
		}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val(str);
	}
	
	

//选择项目负责人回调
function selectPsnCall(data) {
	$(parent.document).find("input[name$='psn_code']").val(data.person.psnCode);
	$("span[name='proposal/fzr_psnname']").text(data.person.zhName);
	
	$("input[name='proposal/fzr_tel']").val(data.person.tel);
	$("span[name='proposal/fzr_prof_title_name']").text(data.personExtend.basic_info.prof_title_name);
	$("span[name='proposal/fzr_position']").text(data.personExtend.basic_info.position);
	$("span[name='proposal/fzr_mail']").text(data.personExtend.contact.email);
	$("input[name='proposal/fzr_mobile']").val(data.personExtend.contact.mobile);
	
	tb_remove2();
}
</script>
